function doDescartar(name, param)
	local player = minetest.get_player_by_name(name)
	if player == nil then
		print("Falha de descarte: Player solicitante nao encontrado.")
		return true -- Handled chat message
	end
	if player:get_wielded_item():is_empty() then
		minetest.chat_send_player(name, 'Falha de descarte: Nao ha nenhum item em sua maos.')
	else
		player:set_wielded_item(nil)
		minetest.chat_send_player(name, 'Item descartado com sucesso.')
	end
end

minetest.register_chatcommand("descartar", {
	params = "",
	description = "Apaga item em suas maos.",
	privs = {},
	func = doDescartar,
})

minetest.register_chatcommand("delete", {
	params = "",
	description = "Apaga item em suas maos.",
	privs = {},
	func = doDescartar,
})

minetest.register_chatcommand("del", {
	params = "",
	description = "Apaga item em suas maos.",
	privs = {},
	func = doDescartar,
})





--minetest.register_chatcommand("clearbone", {
--	params = "<Jogador> | all",
--	description = "Apaga todas as lapides Bones",
--	privs = {interact=true, ban=true},
--	minetest.get_meta(pos):get_string("owner")
--	func = function(name, param)
--		--bones:bones
--		local quem = string.match(param, "([%a%d_]+) (.+)")
--
--		--local has_privs, missing_privs = minetest.check_player_privs(name, cmd_def.privs)
--		--if has_privs then
--		--cmd_def.func(name, param)
--		--else
--		--minetest.chat_send_player(name, "You don't have permission to run this command (missing privileges: "..table.concat(missing_privs, ", ")..")")
--		--end
--		
--		local myChar = minetest.get_player_by_name(name)
--		if quem == myChar then
--			minetest.chat_send_player(name,"VAI APAGAR "..myChar)
--		elseif quem == "all" then
--			minetest.chat_send_player(name,"VAI APAGAR TODOS")
--		else
--			minetest.chat_send_player(name,"/clearbone <Jogador> | all")
--			return
--		end
--	end,
--})



